// 二手电子产品市场信息平台数据

// 创建全局数据对象
window.siteData = window.siteData || {};

// 导航菜单数据
const navData = {
  categories: [
    { name: "二手手机", link: "category.html?type=phone" },
    { name: "二手相机", link: "category.html?type=camera" },
    { name: "二手数码", link: "category.html?type=digital" },
    { name: "二手冰箱", link: "category.html?type=fridge" },
  ],
  pages: [
    { name: "关于我们", link: "about.html" },
    { name: "信息审核制度", link: "information.html" },
    { name: "隐私政策", link: "privacy-policy.html" },
  ],
};

// 首页轮播产品数据
const featuredProducts = [
  {
    id: 1,
    title: "iPhone 12 Pro Max 256GB 深蓝色",
    description: "九成新，无划痕，原装配件齐全，电池健康度90%",
    image: "https://picsum.photos/600/400?random=1",
    price: "4999",
    category: "phones",
    seller: {
      name: "王先生",
      phone: "138****1234",
      location: "北京市海淀区",
    },
  },
  {
    id: 2,
    title: "佳能 EOS R6 全画幅微单相机",
    description: "95新，快门次数不到5000，赠送原厂电池一块",
    image: "https://picsum.photos/600/400?random=2",
    price: "9800",
    category: "cameras",
    seller: {
      name: "李女士",
      phone: "139****5678",
      location: "上海市徐汇区",
    },
  },
  {
    id: 3,
    title: "索尼 WH-1000XM4 无线降噪耳机",
    description: "八成新，音质完美，降噪效果出色",
    image: "https://picsum.photos/600/400?random=3",
    price: "1200",
    category: "digital",
    seller: {
      name: "张先生",
      phone: "135****9012",
      location: "广州市天河区",
    },
  },
  {
    id: 4,
    title: "海尔 215升 三门冰箱",
    description: "使用两年，制冷效果良好，节能省电",
    image: "https://picsum.photos/600/400?random=4",
    price: "1500",
    category: "refrigerators",
    seller: {
      name: "刘女士",
      phone: "136****3456",
      location: "深圳市南山区",
    },
  },
  {
    id: 5,
    title: "小米11 Ultra 12GB+256GB 陶瓷黑",
    description: "95新，无划痕，全套包装配件",
    image: "https://picsum.photos/600/400?random=5",
    price: "3999",
    category: "phones",
    seller: {
      name: "赵先生",
      phone: "137****7890",
      location: "成都市锦江区",
    },
  },
  {
    id: 6,
    title: "尼康 Z6II 全画幅微单相机",
    description: "98新，仅试机使用，原厂包装齐全",
    image: "https://picsum.photos/600/400?random=6",
    price: "11500",
    category: "cameras",
    seller: {
      name: "孙女士",
      phone: "134****2345",
      location: "武汉市江汉区",
    },
  },
  {
    id: 7,
    title: "Apple iPad Pro 12.9英寸 M1芯片",
    description: "九成新，无划痕，配备原装笔和键盘",
    image: "https://picsum.photos/600/400?random=7",
    price: "6500",
    category: "digital",
    seller: {
      name: "周先生",
      phone: "133****6789",
      location: "杭州市西湖区",
    },
  },
  {
    id: 8,
    title: "西门子 610升 对开门冰箱",
    description: "使用一年，外观如新，带保修",
    image: "https://picsum.photos/600/400?random=8",
    price: "4200",
    category: "refrigerators",
    seller: {
      name: "吴女士",
      phone: "132****0123",
      location: "南京市鼓楼区",
    },
  },
  {
    id: 9,
    title: "华为 Mate 40 Pro 8GB+256GB 秋日胡杨",
    description: "95新，无划痕，全套包装配件",
    image: "https://picsum.photos/600/400?random=9",
    price: "4500",
    category: "phones",
    seller: {
      name: "郑先生",
      phone: "131****4567",
      location: "重庆市渝中区",
    },
  },
  {
    id: 10,
    title: "索尼 A7R4 全画幅微单相机",
    description: "95新，快门次数不到3000，赠送原厂电池两块",
    image: "https://picsum.photos/600/400?random=10",
    price: "15800",
    category: "cameras",
    seller: {
      name: "钱女士",
      phone: "130****8901",
      location: "西安市碑林区",
    },
  },
];

// 推荐产品数据
const recommendedProducts = [
  {
    id: 11,
    title: "MacBook Pro 16英寸 M1 Pro芯片",
    description: "95新，无划痕，性能强劲，电池循环次数低",
    image: "https://picsum.photos/600/400?random=11",
    price: "12500",
    category: "digital",
    seller: {
      name: "孙先生",
      phone: "139****2345",
      location: "北京市朝阳区",
    },
  },
  {
    id: 12,
    title: "三星 Galaxy S21 Ultra 5G 12GB+256GB",
    description: "九成新，全套配件，屏幕无划痕",
    image: "https://picsum.photos/600/400?random=12",
    price: "5200",
    category: "phones",
    seller: {
      name: "林女士",
      phone: "138****6789",
      location: "广州市海珠区",
    },
  },
  {
    id: 13,
    title: "美的 320升 法式多门冰箱",
    description: "使用一年半，制冷效果好，外观干净",
    image: "https://picsum.photos/600/400?random=13",
    price: "2300",
    category: "refrigerators",
    seller: {
      name: "王先生",
      phone: "137****0123",
      location: "上海市浦东新区",
    },
  },
];

// 产品详情页数据
const productDetails = {};

// 分类页面数据
const categoryData = {
  phones: {
    title: "二手手机",
    description: "各类品牌二手手机，品质保证，价格实惠",
    products: [1, 5, 9, 12],
  },
  cameras: {
    title: "二手相机",
    description: "专业相机设备，爱好者的理想选择",
    products: [2, 6, 10],
  },
  digital: {
    title: "二手数码",
    description: "各类数码产品，包括平板、耳机、笔记本等",
    products: [3, 7, 11],
  },
  refrigerators: {
    title: "二手冰箱",
    description: "品质家电，节能环保，价格优惠",
    products: [4, 8, 13],
  },
};

// VIP特权数据
const vipPrivileges = [
  {
    title: "优先展示",
    description: "您的商品将在搜索结果和分类页面中优先展示",
  },
  {
    title: "特殊标记",
    description: '您的商品将获得"诚信卖家"特殊标记，提高信任度',
  },
  {
    title: "无限发布",
    description: "不限制每月发布商品的数量",
  },
  {
    title: "专属客服",
    description: "获得专属客服支持，优先解决问题",
  },
];

// 公司信息数据
const companyInfo = {
  name: "二手电子乐园科技有限公司",
  address: "北京市海淀区中关村科技园区8号楼305室",
  email: "contact@2ndelectronics.com",
  phone: "400-123-4567",
  icp: "京ICP备12345678号-1",
  businessHours: "周一至周日 9:00-18:00",
  about:
    "二手电子乐园创立于2020年，是中国领先的二手电子产品信息服务平台。我们致力于为用户提供安全、便捷、透明的二手电子产品交易信息服务，让闲置物品流通起来，让资源得到更好的利用。平台严格审核卖家信息，保障买家权益，打造诚信的二手交易环境。",
};

// 使数据全局可用
window.siteData = {
  navData: navData,
  featuredProducts: featuredProducts,
  recommendedProducts: recommendedProducts,
  productDetails: productDetails,
  categoryData: categoryData,
  vipPrivileges: vipPrivileges,
  companyInfo: companyInfo,
};

// 添加调试信息
console.log(
  "数据已加载，共有产品：",
  window.siteData.featuredProducts.length + window.siteData.recommendedProducts.length
);
